﻿using System.Reflection;
using Purest.BackgroundService;
using Purest.Core.Mapster;
using Purest.Multiplex;
using Purest.SqlSugar;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Modularity;

namespace PurestMerchant.Application
{
    [DependsOn(typeof(SqlSugarModule), typeof(BackgroundModule), typeof(MultiplexModule))]
    public class MerchantAppModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddMapsterIRegister(Assembly.GetExecutingAssembly());
            Configure<AbpAspNetCoreMvcOptions>(options =>
            {
                options.ConventionalControllers.Create(typeof(MerchantAppModule).Assembly, opts =>
                {
                    opts.RootPath = "merchant";
                    opts.ControllerModelConfigurer = model =>
                    {
                        model.ApiExplorer.GroupName = "merchant";
                    };

                    //opts.UrlActionNameNormalizer = (action) =>
                    //{
                    //    return action.ActionNameInUrl;
                    //};
                });
            });
            base.ConfigureServices(context);
        }
    }
}
